package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GenotypesSowing generated by hbm2java
 */
@Entity
@Table(name="genotypes_sowing"
    ,catalog="madr_bd10"
)
public class GenotypesSowing  implements java.io.Serializable {


     private Integer idGenSow;
     private String nameGenSow;
     private boolean statusGenSow;
     private Set sowings = new HashSet(0);
     private Set cropsTypeses = new HashSet(0);

    public GenotypesSowing() {
    }

	
    public GenotypesSowing(String nameGenSow, boolean statusGenSow) {
        this.nameGenSow = nameGenSow;
        this.statusGenSow = statusGenSow;
    }
    public GenotypesSowing(String nameGenSow, boolean statusGenSow, Set sowings, Set cropsTypeses) {
       this.nameGenSow = nameGenSow;
       this.statusGenSow = statusGenSow;
       this.sowings = sowings;
       this.cropsTypeses = cropsTypeses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_gen_sow", unique=true, nullable=false)
    public Integer getIdGenSow() {
        return this.idGenSow;
    }
    
    public void setIdGenSow(Integer idGenSow) {
        this.idGenSow = idGenSow;
    }
    
    @Column(name="name_gen_sow", nullable=false, length=45)
    public String getNameGenSow() {
        return this.nameGenSow;
    }
    
    public void setNameGenSow(String nameGenSow) {
        this.nameGenSow = nameGenSow;
    }
    
    @Column(name="status_gen_sow", nullable=false)
    public boolean isStatusGenSow() {
        return this.statusGenSow;
    }
    
    public void setStatusGenSow(boolean statusGenSow) {
        this.statusGenSow = statusGenSow;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="genotypesSowing")
    public Set getSowings() {
        return this.sowings;
    }
    
    public void setSowings(Set sowings) {
        this.sowings = sowings;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="genotypes_sowing_crop_types", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_gentoypes_sowing_gen_sow_cro", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_crop_type_gen_sow_cro", nullable=false, updatable=false) })
    public Set getCropsTypeses() {
        return this.cropsTypeses;
    }
    
    public void setCropsTypeses(Set cropsTypeses) {
        this.cropsTypeses = cropsTypeses;
    }




}


